home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
001a
/
bbsslt2.zip
/
CH1NEW.SLT
< prev
next >
Wrap
Text File
|
1991-12-16
|
11KB
|
260 lines
//***************************************************************************
//*** *
//*** C H A N N E L 1 - - N E W F I L E S *
//*** *
//*** Description: *
//*** Telix Script that automates downloading of new files information *
//*** from Channel 1 BBS. *
//*** *
//*** Script logic: *
//*** 1) Dials number specified by "phoneRow" variable. *
//*** 2) Logon to BBS automatically. *
//*** 3) Request list all new files since last logon. *
//*** 4) Deletes backup file specified by "oldCaptureFileF" variable. *
//*** 5) Renames current file specified by "newCaptureFile" variable to *
//*** backup file specified by "oldCaptureFile" variable. *
//*** 6) Captures new files into file specified by "newCaptureFile" *
//*** variable. *
//*** 7) Logoff BBS *
//*** 8) Issue "hangup" to modem *
//*** 9) Exit Telix. *
//*** *
//*** Instructions: *
//*** To customize, fill in info wherever you find a //?? comment. *
//*** *
//*** Hints: *
//*** This script is goes after the new files directoryy (U) on the *
//*** Channel 1 BBS. You can be more specific by changing the *
//*** "newFilesDir" constant to the exact directories you want. *
//*** *
//*** example: str newFilesDir [] = "3 30 45 66 77; *
//*** *
//*** This will allow you to get all new files in the respective file *
//*** directories. *
//*** *
//*** Script is easily modifible for other BBS's! *
//*** *
//*** Author: *
//*** Joel R. DeRider *
//*** Jona Computer Associates *
//*** 181 Colleen Ave. *
//*** Shoreview, MN 55126-6253 *
//*** (612) 490-1238 *
//*** *
//*** Change Log: *
//*** 12/15/91 - Initial Revision. Dedicated to the public domain. *
//*** *
//*** *
//*** *
//*** *
//***************************************************************************
main()
{
str phoneRow [] = "?"; //?? point to BBS row in dialing dir
str firstName [] = "?"; //?? Your first name
str lastName [] = "?"; //?? Your last name
str bbsPassword [] = "?"; //?? Your BBS password
str newFilesLib [] = "U"; //?? set to R&E new dir
str oldCaptureFile [] = "ch1old.txt"; //?? (no path)
str newCaptureFile [] = "h:\download\ch1new.txt"; //?? (enter full path)
str oldCaptureFileF [] = "h:\download\ch1old.txt"; //?? (enter full path)
str cr [] = "^M";
str respondYes [] = "y";
str respondNo [] = "n";
str newFiles [] = "n";
str nonStop [] = "ns";
str goodBye [] = "g";
int stringHit;
//------------------------------------------------------------------------
// String variables that will contain the strings to track thru the three
// loops A, B, and C.
//------------------------------------------------------------------------
int aTrackedString1, aTrackedString2, aTrackedString3, aTrackedString4,
aTrackedString5, aTrackedString6, aTrackedString7, aTrackedString8,
aTrackedString9;
int bTrackedString1, bTrackedString2, bTrackedString3;
int cTrackedString1, cTrackedString2, cTrackedString3, cTrackedString4;
dial (phoneRow,0); // Make the phone call
//------------------------------------------------------------------------
// Set the tracking strings for loop A.
//------------------------------------------------------------------------
aTrackedString1 = track ("Enter Language # to use (Enter)=no change?", 1);
aTrackedString2 = track ("Do you want Color? Y=Yes, N or Enter = No?", 1);
aTrackedString3 = track ("Enter your first name?", 1);
aTrackedString4 = track ("Enter your last name?", 1);
aTrackedString5 = track ("Password (Dots will echo)?", 1);
aTrackedString6 = track ("Help, NS, N=Stop, (Enter)=More?", 1);
aTrackedString7 = track ("continue", 1);
aTrackedString8 = track ("Scan Message Base Since 'Last Read'?", 1);
aTrackedString9 = track ("Channel 1 command?", 1);
//------------------------------------------------------------------------
// LOOP A
// Will get you logged on, and enter the new files command at main menu.
//------------------------------------------------------------------------
while (1)
{
terminal();
stringHit = track_hit (0);
if (stringHit == aTrackedString1)
{
cputs (cr);
track_free (aTrackedString1);
}
else if (stringHit == aTrackedString2 )
{
cputs (respondNo);
cputs (cr);
track_free (aTrackedString2);
}
else if (stringHit == aTrackedString3)
{
cputs (firstName);
cputs (cr);
track_free (aTrackedString3);
}
else if (stringHit == aTrackedString4)
{
cputs (lastName);
cputs (cr);
track_free (aTrackedString4);
}
else if (stringHit == aTrackedString5)
{
cputs (bbsPassword);
cputs (cr);
track_free (aTrackedString5);
}
else if (stringHit == aTrackedString6)
{
cputs (respondNo);
cputs (cr);
}
else if (stringHit == aTrackedString7)
{
cputs (cr);
}
else if (stringHit == aTrackedString8)
{
cputs (respondNo);
cputs (cr);
track_free (aTrackedString8);
}
else if (stringHit == aTrackedString9)
{
cputs (newFiles);
cputs (cr);
track_free (aTrackedString9);
break;
}
}
//------------------------------------------------------------------------
// Clear then set the tracking strings for loop B.
//------------------------------------------------------------------------
track_free (0);
bTrackedString1 = track ("Date as (mmddyy) to search from? Enter=?", 1);
bTrackedString2 = track ("(A)ll, (U)ploads, (Enter)=none?", 1);
bTrackedString3 = track ("(H)elp, (V)iew, (F)lag, More?", 1);
//------------------------------------------------------------------------
// LOOP B
// Start the capture file processing.
//------------------------------------------------------------------------
while (1)
{
terminal();
stringHit = track_hit (0);
if (stringHit == bTrackedString1)
{
cputs (cr);
track_free (bTrackedString1);
}
else if (stringHit == bTrackedString2)
{
fdelete (oldCaptureFileF);
frename (newCaptureFile, oldCaptureFile);
capture (newCaptureFile);
cputs (newFilesLib);
cputs (cr);
track_free (bTrackedString2);
}
else if (stringHit == bTrackedString3)
{
cputs (nonStop);
cputs (cr);
track_free (bTrackedString3);
break;
}
}
//------------------------------------------------------------------------
// Clear then set the tracking strings for loop C.
//------------------------------------------------------------------------
track_free (0);
cTrackedString1 = track ("(H)elp, (V)iew, (F)lag, More?", 1);
cTrackedString2 = track ("Channel 1 command?", 1);
//------------------------------------------------------------------------
// LOOP C
// It ends the capture file processing then says goodbye to the BBS.
//------------------------------------------------------------------------
while (1)
{
terminal();
stringHit = track_hit (0);
if (stringHit == cTrackedString1)
{
capture ("*CLOSE*");
cputs (nonStop);
cputs (cr);
track_free (cTrackedString1);
}
else if (stringHit == cTrackedString2)
{
cputs (goodBye);
cputs (cr);
break;
track_free (cTrackedString2);
}
}
//------------------------------------------------------------------------
// Let's clean up after ourselves!!
//------------------------------------------------------------------------
track_free (0); // Clear all the tracking strings.
hangup (); // Hang up the phone.
exittelix (0,1); // Exit Telix (to DOS.)
return; // Make compiler happy and return from main.
}